package com.itheima.config;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @author 吴
 * @version V1.0
 * @Description 自定义返回User信息 ，包含用户的全部信息，默认只包含密码和用户名
 * @Package com.itheima.config
 * @date 2021/11/28 15:53
 */
public class MyUserConfig extends User {

    private com.itheima.pojo.User userInfo;

    public com.itheima.pojo.User getUser() {
        return userInfo;
    }

    public MyUserConfig(com.itheima.pojo.User user, Collection<? extends GrantedAuthority> authorities) {
        super(user.getUsername(), user.getPassword(), authorities);
        this.userInfo = user;
    }
}
